<template>
<v-label>当前等待：{{status.queue}}，预计等待：{{remainingTime}}s</v-label>
  <v-progress-linear
      v-model="defaultPercent"
      color="primary"
      height="20"
  >
    <template v-slot:default="{ value }">
      <strong>{{ Math.ceil(value) }}%</strong>
    </template>
  </v-progress-linear>
</template>
<script lang="ts" setup>

// const defaultPercent=defineModel({
//   default:0
// })
// const  defaultPercent=ref(0)

const {status}=storeToRefs(useStableDiffusionStore())
const defaultPercent=computed(()=>status.value.progress)

const remainingTime=computed(()=>{
  return status.value.time_remained
})


// socketInit()

// setInterval(() => {
//   const percent = defaultPercent.value + 1;
//   defaultPercent.value = percent > 100 ? 100 : percent;
// },1000)

// const increase = () => {
//   const percent = defaultPercent.value + 10;
//   defaultPercent.value = percent > 100 ? 100 : percent;
// };
//
// const decline = () => {
//   const percent = defaultPercent.value - 10;
//   defaultPercent.value = percent < 0 ? 0 : percent;
// };



</script>`

